<?php


namespace App\Http\Controllers;


class BaseController
{
    protected function success($data = [], $message = 'success')
    {
        return response()->json([
            'code' => 200,
            'message' => $message,
            'data'  => $data
        ]);
    }

    protected function error($code = 500, $message = 'error')
    {
        return response()->json([
            'code' => $code,
            'message' => $message,
            'data'  => []
        ]);
    }
}
